﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IntelligentAgriculture.Contracts.Dto.Output
{
    /// <summary>
    /// 分页返回结果
    /// </summary>
    public class PageOutput<T>
    {
        /// <summary>
        /// 数据
        /// </summary>
        public List<T>? Data { get; set; }

        /// <summary>
        /// 总条数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 页大小
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int PageCount => Convert.ToInt32(Math.Ceiling(TotalCount / 1.0 / PageSize));
        // public int TotalPage 
        // {
        //     get
        //     {
        //         return Convert.ToInt32(Math.Ceiling(TotalCount / 1.0 / PageSize));
        //     }
        // }
    }
}
